package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.AskedMapper;
import com.jieshuibao.model.db.Asked;
import com.jieshuibao.model.db.AskedExample;

@Service
public class AskedService{
	
	@Resource
	private AskedMapper askedMapper;
	
	public void addAsked(Asked asked) {
		askedMapper.insertSelective(asked);
	}
	
	public void delAskedByUuid(String uuid) {
		askedMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateAsked(Asked asked) {
		askedMapper.updateByPrimaryKeySelective(asked);
	}
	
	public Asked getAskedByUuid(String uuid) {
		return askedMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Asked> getPageAsked(AskedExample askedExample) {
		return askedMapper.selectPage(askedExample);
	}
	
	public int countAsked(AskedExample askedExample) {
		return askedMapper.countByExample(askedExample);
	}
}
